package com.ts.core.controller.api;


import com.baomidou.mybatisplus.extension.api.R;
import com.ts.core.entity.Dict;
import com.ts.core.service.DictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 数据字典 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2024-03-24
 */
@Api(tags = "用户页字典管理")
@RestController
@RequestMapping("/core/dict")

public class DictController {
    @Resource
    private DictService dictService;

    @ApiOperation("根据dictCode获取下级节点")
    @GetMapping("/findByDictCode/{dictcode}")
    public Map<String,Object> findByDictCode(
            @PathVariable String dictcode
    ){
     List<Dict> list=  dictService.findByDictCode(dictcode);
     HashMap<String, Object> map = new HashMap<>();
     map.put("code",0);
     map.put("messsage","成功");

     HashMap<String, Object> data = new HashMap<>();
     data.put("dict",list);
     map.put("data",data);


     return map;


    }




}

